package com.example.demo.codegenerate.domain;

public class JeecgColumn {
    private String id;

    /**
     *
     */
    private String jeecgTableId;

    /**
     * 数据库列名
     */
    private String name;

    /**
     * java类型
     */
    private String javaType;

    /**
     * 数据库类型
     */
    private String databaseType;

    /**
     * 显示类型
     */
    private String ctrlType;

    /**
     * 是否主键
     */
    private boolean pm = false;

    /**
     * 最大长度
     */
    private int maxLength = 0;

    /**
     * 是否唯一
     */
    private boolean uq = false;

    /**
     * 是否允许为空
     */
    private boolean nullable = true;

    /**
     * 注释
     */
    private String comment = "";

    /**
     * 默认值
     */
    private String _default;

    /**
     * 关联表及字段
     */
    private String link;

    /**
     * 是否查询
     */
    private boolean query;

    /**
     * 表单显示
     */
    private boolean formShow;

    /**
     * 列表显示
     */
    private boolean listShow;

    private int sequence;

    private String jdbcType;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getJeecgTableId() {
        return jeecgTableId;
    }

    public void setJeecgTableId(String jeecgTableId) {
        this.jeecgTableId = jeecgTableId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getJavaType() {
        return javaType;
    }

    public void setJavaType(String javaType) {
        this.javaType = javaType;
    }

    public String getDatabaseType() {
        return databaseType;
    }

    public void setDatabaseType(String databaseType) {
        this.databaseType = databaseType;
    }

    public boolean isPm() {
        return pm;
    }

    public void setPm(boolean pm) {
        this.pm = pm;
    }

    public int getMaxLength() {
        return maxLength;
    }

    public void setMaxLength(int maxLength) {
        this.maxLength = maxLength;
    }

    public boolean isUq() {
        return uq;
    }

    public void setUq(boolean uq) {
        this.uq = uq;
    }

    public boolean isNullable() {
        return nullable;
    }

    public void setNullable(boolean nullable) {
        this.nullable = nullable;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String get_default() {
        return _default;
    }

    public void set_default(String _default) {
        this._default = _default;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public boolean isQuery() {
        return query;
    }

    public void setQuery(boolean query) {
        this.query = query;
    }

    public boolean isFormShow() {
        return formShow;
    }

    public void setFormShow(boolean formShow) {
        this.formShow = formShow;
    }

    public boolean isListShow() {
        return listShow;
    }

    public void setListShow(boolean listShow) {
        this.listShow = listShow;
    }

    public String getCtrlType() {
        return ctrlType;
    }

    public void setCtrlType(String ctrlType) {
        this.ctrlType = ctrlType;
    }

    public int getSequence() {
        return sequence;
    }

    public void setSequence(int sequence) {
        this.sequence = sequence;
    }

    public String getJdbcType() {
        if("TEXT".equals(databaseType))
            return "VARCHAR";
        if("LONGTEXT".equals(databaseType))
            return "VARCHAR";
        return databaseType;
    }
}
